package com.cangshukj.junong.service.impl;

import java.util.List;
import com.cangshukj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cangshukj.junong.mapper.SalesTypeMapper;
import com.cangshukj.junong.domain.SalesType;
import com.cangshukj.junong.service.ISalesTypeService;

/**
 * 销售服务分类Service业务层处理
 * 
 * @author wangjie
 * @date 2025-04-01
 */
@Service
public class SalesTypeServiceImpl implements ISalesTypeService 
{
    @Autowired
    private SalesTypeMapper salesTypeMapper;

    /**
     * 查询销售服务分类
     * 
     * @param typeId 销售服务分类主键
     * @return 销售服务分类
     */
    @Override
    public SalesType selectSalesTypeByTypeId(String typeId)
    {
        return salesTypeMapper.selectSalesTypeByTypeId(typeId);
    }

    /**
     * 查询销售服务分类列表
     * 
     * @param salesType 销售服务分类
     * @return 销售服务分类
     */
    @Override
    public List<SalesType> selectSalesTypeList(SalesType salesType)
    {
        return salesTypeMapper.selectSalesTypeList(salesType);
    }

    /**
     * 新增销售服务分类
     * 
     * @param salesType 销售服务分类
     * @return 结果
     */
    @Override
    public int insertSalesType(SalesType salesType)
    {
        salesType.setCreateTime(DateUtils.getNowDate());
        return salesTypeMapper.insertSalesType(salesType);
    }

    /**
     * 修改销售服务分类
     * 
     * @param salesType 销售服务分类
     * @return 结果
     */
    @Override
    public int updateSalesType(SalesType salesType)
    {
        salesType.setUpdateTime(DateUtils.getNowDate());
        return salesTypeMapper.updateSalesType(salesType);
    }

    /**
     * 批量删除销售服务分类
     * 
     * @param typeIds 需要删除的销售服务分类主键
     * @return 结果
     */
    @Override
    public int deleteSalesTypeByTypeIds(String[] typeIds)
    {
        return salesTypeMapper.deleteSalesTypeByTypeIds(typeIds);
    }

    /**
     * 删除销售服务分类信息
     * 
     * @param typeId 销售服务分类主键
     * @return 结果
     */
    @Override
    public int deleteSalesTypeByTypeId(String typeId)
    {
        return salesTypeMapper.deleteSalesTypeByTypeId(typeId);
    }

    @Override
    public List<SalesType> selectSalesTypeByPid(String typeId) {
        return salesTypeMapper.selectSalesTypeByPid(typeId);
    }
}
